Cheap deforestation for non-strict functional languages

نویسنده

  • Andrew John Gill
چکیده

In functional languages intermediate data structures are often used as glue to connect separate parts of a program together. Deforestation is the process of automatically removing intermediate data structures. In this thesis we present and analyse a new approach to deforestation. This new approach is both practical and general. We analyse in detail the problem of list removal rather than the more general problem of arbitrary data structure removal. This more limited scope allows a complete evaluation of the pragmatic aspects of using our deforestation technology. We have implemented our list deforestation algorithm in the Glasgow Haskell compiler. Our implementation has allowed practical feedback. One important conclusion is that a new analysis is required to infer function arities and the linearity of lambda abstractions. This analysis renders the basic deforestation algorithm far more effective. We give a detailed assessment of our implementation of deforestation. We measure the effectiveness of our deforestation on a suite of real application programs. We also observe the costs of our deforestation algorithm.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Cheap Deforestation in Practice: An Optimizer for Haskell

We present a simple, automatic transformation — the foldr/build transformation — which successfully removes many intermediate lists from programs written in non-strict functional programming languages. While the idea is simple and elegant, it turns out that some care is needed in the compiler to set up the right conditions for the foldr/build transformation to be applicable. We report on this p...

متن کامل

Profiling Lazy Functional Programs

Prooling tools, which measure and display the dynamic space and time behaviour of programs, are essential for identifying execution bottlenecks. A variety of such tools exist for conventional languages, but almost none for non-strict functional languages. There is a good reason for this: lazy evaluation means that the program is executed in an order which is not immediately apparent from the so...

متن کامل

List - Processing Optimizations in Curry ? Elvira Albert 1 , C

The multi-paradigm language Curry integrates features from functional, logic, and concurrent programming. In this work, we consider two well-known list-processing optimizations: short cut deforestation (from functional programming) and diierence-lists (from logic programming), and study their adaptation to our integrated setting. While short cut deforestation adapts smoothly, the use of diieren...

متن کامل

Partitioning Non-strict Functional Languages for Partitioning Non-strict Functional Languages for Multi-threaded Code

In this paper, we present a new approach to partitioning, the problem of generating sequential threads for programs written in a non-strict functional language. The goal of partitioning is to generate threads as large as possible, while retaining the non-strict semantics of the program. We deene partitioning as a program transformation and design algorithms for basic block partitioning and inte...

متن کامل

Non-Strict Languages - Programming and Implementation

Non-strict evaluation improves the expressive power of functional languages at the expense of an apparent loss of eeciency. In this paper we give examples of this expressive power, taking as an example an interactive functional program and describing the programming techniques depending on non-strict evaluation which improved its design. Implementation methods for non-strict languages have deli...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1996